<!DOCTYPE HTML>
<html>
<head>
<title>EnvMult | AutoHotkey</title>
<meta name="description" content="The EnvMult command sets a variable to itself times the given value." />
<meta name="ahk:equiv-v2" content="Variables.htm#MulDiv" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
</head>
<body>

<h1>EnvMult</h1>

<p>设置<a href="../Variables.htm">变量</a>的值为它自身乘以给定的值. 等同于: <code>Var *= Value</code></p>
<p class="warning"><strong>过时的:</strong> 不推荐在新脚本中使用此命令. 请使用 <code>Var := Var * Value</code> 或 <code>Var *= Value</code> 代替.</p>

<pre class="Syntax"><span class="func">EnvMult</span>, Var, Value</pre>
<h2 id="Parameters">参数</h2>
<dl>

  <dt>Var</dt>
  <dd><p>要运算的<a href="../Variables.htm">变量</a>名.</p></dd>

  <dt>Value</dt>
  <dd><p>任何整数, 浮点数或<a href="../Variables.htm#Expressions">表达式</a>.</p></dd>

</dl>

<h2 id="Remarks">备注</h2>
<p>此命令等同于这种简写形式: <code>Var *= Value</code>.</p>
<p>如果 <em>Var</em> 或 <em>Value</em> 其中一个为空或不以数字开头, 那么在计算中它会被视为 0(不过用在表达式 <em>内部</em> 时例外, 例如 <code>Var := X *= Y</code>).</p>
<p>如果 <em>Var</em> 或 <em>Value</em> 都为小数, 那么最后的结果将为浮点数, 而格式由 <a href="SetFormat.htm">SetFormat</a> 决定.</p>
<h2 id="Related">相关</h2>
<p><a href="EnvAdd.htm">EnvAdd</a>, <a href="EnvSub.htm">EnvSub</a>, <a href="EnvDiv.htm">EnvDiv</a>, <a href="SetFormat.htm">SetFormat</a>, <a href="../Variables.htm#Expressions">表达式</a>, <a href="IfIs.htm">If var is [not] type</a>, <a href="SetEnv.htm">SetEnv</a>, <a href="Transform.htm">按位运算(Transform)</a></p>
<h2 id="Examples">示例</h2>
<div class="ex" id="ExBasic">
<p><a class="ex_number" href="#ExBasic"></a> 设置 <var>MyCount</var> 为自身乘以 2.</p>
<pre>EnvMult, MyCount, 2</pre>
</div>

<div class="ex" id="ExOperator">
<p><a class="ex_number" href="#ExOperator"></a> 等同于上面的语句.</p>
<pre>MyCount *= 2</pre>
</div>

</body>
</html>